<template>
    <el-input
            :disabled="disabled"
            rows="10"
            :type="type"
            v-model="model"
            suffix-icon="el-icon-search"
      size="small"
            :placeholder="placeholder"
            :onkeyup="change()">
    </el-input>
</template>
<script>
    export default {
        name: 'XDInput',
        props: ["value", "dataType", "required", "type", "disabled","placeholder"],
        data() {
            return {
                model: "",
                show: false
            }
        },
        methods: {
            change() {
                if (this.dataType == 'int') {
                    if (this.model != null) {
                        this.model = this.model.toString().replace(/[^\d]/g,'')
                    }else {
                        this.model = ''
                    }
                    this.placeholder = "请输入数字"
                }
                this.$emit("input", this.model)
            },
        },
        watch: {
            "value": function() {
                this.model = this.value
            }
        },
        created() {
            this.model = this.value
        }
    }
</script>
<style>
</style>